//package com.amigo.online.provider.search.rocketmq.consumer;
//
//import java.util.ArrayList;
//import java.util.List;
//
//import javax.annotation.Resource;
//
//import org.apache.solr.client.solrj.SolrClient;
//import org.apache.solr.common.SolrInputDocument;
//import org.slf4j.Logger;
//import org.slf4j.LoggerFactory;
//import org.springframework.stereotype.Component;
//
//import com.amigo.online.common.param.result.VideoInfo;
//import com.amigo.online.provider.search.rocketmq.PushMessage;
//import com.amigo.online.provider.search.rocketmq.model.BaseMqSendModel;
//
//@Component("VideoToSolrConsumer")
//public class VideoToSolrConsumer implements PushMessage {
//	
//	private static final Logger log = LoggerFactory.getLogger(VideoToSolrConsumer.class);
//	
//	@Resource(name = "SolrClient_video")
//	private SolrClient solrClient_video;
//
//	@Override
//	public void handleMessage(BaseMqSendModel baseMqSendModel) throws Exception {
//		log.info("video消费开始......");
//		VideoInfo videoInfo = baseMqSendModel.getSendContentBean(VideoInfo.class);
//		log.info("videoInfo数据为" + videoInfo);
//		// 为文档添加域
//		List<SolrInputDocument> doc1 = new ArrayList<SolrInputDocument>();
//		// 4、为文档添加域
//		SolrInputDocument document = new SolrInputDocument();
//		document.addField("id", videoInfo.getId() + "");// 视频id
//		document.addField("userId", videoInfo.getUserId() + "");// 用户id
//		document.addField("video", videoInfo.getVideo() + "");// 视频地址
//		document.addField("cover", videoInfo.getCover() + "");// 封面
//		document.addField("duration", videoInfo.getDuration() + "");// 封面
//		document.addField("href", videoInfo.getHref() + "");// 跳转地址
//		document.addField("type", videoInfo.getType() + "");// 类型
//		document.addField("ads", videoInfo.getAds() + "");// 是否是广告
//		document.addField("recommended", videoInfo.getRecommended() + "");// 推荐
//		document.addField("up", videoInfo.getUp() + "");// 点赞数量
//		document.addField("look", videoInfo.getLook() + "");// 观看数量		
//		document.addField("contentcount", videoInfo.getContent()+"");// 视频信息		
//		document.addField("comment", videoInfo.getComment() + "");// 评论数量
//		document.addField("nickname_user", videoInfo.getNickname() + "");
//		document.addField("avatar", videoInfo.getAvatar() + "");
//		document.addField("height", videoInfo.getHeight() + "");
//		document.addField("width", videoInfo.getWidth() + "");
//		document.addField("share", videoInfo.getShare() + "");
//		document.addField("id_music", videoInfo.getMusicId() + "");
//		log.info("contentcount数据为:" + videoInfo.getContent() + "");
//		doc1.add(document);
//
//		solrClient_video.add(doc1);
//		solrClient_video.commit();
//		log.info("video消费结束进入solr索引库......");
//	}
//
//
//}
